package cn.iocoder.yudao.module.trade.scan.api;

import cn.iocoder.yudao.framework.common.exception.Assertions;
import cn.iocoder.yudao.module.api.trade.scan.ScanOrderApi;
import cn.iocoder.yudao.module.api.trade.scan.dto.ScanOrderDTO;
import cn.iocoder.yudao.module.trade.scan.service.AppScanOrderService;
import cn.iocoder.yudao.module.trade.scan.vo.AppScanOrderVO;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;

/**
 * <pre>
 * OOoO0OOoO0OOOooo0oOOOO0OOOOO0oooOO0ooOOO0Ooooo0OOOOo0ooooO0OOooo0Ooooo0OOOOO
 *  这里是文件说明
 * OOoO0OOoO0OOOooo0oOOOO0OOOOO0oooOO0ooOOO0Ooooo0OOOOo0ooooO0OOooo0Ooooo0OOOOO
 * </pre>
 *
 * @author 山野羡民（1032694760@qq.com）
 * @since 2025/03/31
 */
@Service
@Validated
public class ScanOrderApiImpl implements ScanOrderApi {
    @Resource
    private AppScanOrderService appScanOrderService;

    @Override
    public ScanOrderDTO getByTradeNo(String no) {
        AppScanOrderVO respVO = appScanOrderService.getByTradeNo(no);
        Assertions.notNull(respVO, "未获取到线下扫码订单信息");
        return respVO;
    }

    @Override
    public boolean isNewShopCustomer(Long shopId, Long userId) {
        return appScanOrderService.isNewShopCustomer(shopId, userId);
    }

}
